#pragma once

#include <Windows.h>
#include <WinDef.h>
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>

#define MAX_BROADCAST_CHANNELS				4
#define LIMIT_FRAME_FIFO_COUNT				512
#define LIMIT_VIDEO_FRAME_TOTAL_SIZE		(2 * 1024 * 1024)		// Video		-- Total buffer size
#define LIMIT_VIDEO_FRAME_SIZES				(300 * 1024)			// Video		-- One frame size
#define LIMIT_AUDIO_FRAME_TOTAL_SIZE		(200 * 1024)			// Audio		-- Total buffer size
#define LIMIT_AUDIO_FRAME_SIZES				(50 * 1024)				// Audio		-- One frame size
#define LIMIT_VIDEO_RAW_FRAME_SIZES			(700 * 1024)			// Video		-- One frame size for raw data
#define LIMIT_VIDEO_RAW_FRAME_TOTAL_SIZE	(30 * 700 * 1024)		// Video		-- Total buffer size for raw data

typedef struct _STREAM_CONFIGURE_INFO_
{
	int		int_stream_id;			// stream_id -- Identifier of stream
	int		int_stream_input_type;	// web-cam, ip camera, screen capture, video source, etc
	int		int_protocal_type;		// RTSP, RTMP, RAW
	int		int_stream_status;		// play, stop, hold
	char	str_stream_token[16];	// stream_token string-128bit
	char	str_upload_url[256];	// Wowza Upload URL
	char	str_schedule_info[256];	// Stream Management Schedule
	int		int_connect_status_video;	// Video stream connect status
	int		int_connect_status_audio;	// Audio stream connect status

	// for Video
	char	str_camera_name[256];	// Camera Name
	int		int_video_codec_id;	// Video Codec ID (H264, MJPEG, etc)
	int		int_in_width;		// Frame resolution width
	int		int_in_height;		// Frame resolution height
	int		int_brightness;
	int		int_contrast;
	int		int_pan;
	int		int_tilt;
	int		int_zoom;
	BOOL	bln_autofocus;
	int		int_fps;
	int		int_gop_size;
	int		int_video_framerate;
	int		int_video_bitrate;
	
	// for Audio
	int		int_audio_codec_id;				// Audio Codec ID(PCM-u, AAC, etc)
	int		int_audio_source_type;			// MIC-in, AUDIO-in, etc
	int		int_audio_bitrate;				// Audio bitrate
	char	str_in_audio_extra_data[16];	// Audio extra_data
	int		int_in_audio_extra_size;		// Audio extra_datasize
	int		int_in_audio_sampling_frequency;	// Audio sampling frequency
	int		int_in_audio_channels;				// Audio channel counts

} STREAM_CONFIGURE_INFO;

#ifdef GLOBALMEMORYINSTANCE_EXPORTS
#define DLL_PUBLIC_GMINSTANCE __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
#else
#define DLL_PUBLIC_GMINSTANCE __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
#endif
